﻿using System;

class NFaktorialKFaktorial
{
    static void Main()
    {
        //Write a program that calculates N!/K! for given N and K (1<K<N).

        Console.Write("N = ");
        int n = int.Parse(Console.ReadLine());
        Console.Write("K = ");
        int k = int.Parse(Console.ReadLine());
        decimal factorialN = 1;
        decimal factorialK = 1;

        if (n > k && k > 1)
        {
            for (int i = 1; i <= n; i++)
            {
                factorialN *= i;
            }
            for (int j = 1; j <= k; j++)
            {
                factorialK *= j;
            }

            decimal result = factorialN / factorialK;
            Console.WriteLine("N! = {0}", factorialN);
            Console.WriteLine("K! = {0}", factorialK);
            Console.WriteLine("N!/K! = {0}", result);
        }       
    }
}

